package com.xiangxiangjd.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 
 * </p>
 *
 * @author 肖守凯
 * @since 2021-07-15
 */
@Data
@TableName("unit")
@ApiModel(value="Unit对象", description="")
public class Unit extends Model<Unit> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "单位id")
    @TableId(value = "id",type= IdType.ID_WORKER_STR)
    private String id;

    @ApiModelProperty(value = "单位名称")
    @TableField("unit_name")
    private String unitName;

    @ApiModelProperty(value = "上级id(顶级id 为0)")
    @TableField("parent_id")
    private String parentId;

    //下级菜单   所有的子集存储   CategoryEntity 该类自己
    @TableField(exist = false)
    private List<Unit> children;

    //获取所有的上级菜单
    @TableField(exist = false)
    private Unit fatherUnit;


}
